package com.ruhaly.springboot.controller;

import com.ruhaly.springboot.dao.mapper.RoleMapper;
import com.ruhaly.springboot.dao.mapper.UserMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class HelloController {

    @Autowired
    RoleMapper roleMapper;
    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    UserMapper userMapper;


    @RequestMapping("/hello")
    public List sayHello(){
//        RoleExample roleExample = new RoleExample();
//        roleExample.createCriteria().andRoleIdEqualTo("2");
//        List<Role> list = roleMapper.selectByExample(roleExample);
//        logger.debug(list.toString());
        System.out.printf(userMapper.getAllUser().toString());
        return userMapper.getAllUser();
    }
}
